package de.uni_saarland.coli.doclists.suffixtree;

import de.uni_saarland.coli.doclists.index.IDiscIO;

public interface IEdgeManager extends IDiscIO {

	/**
	 * Creates a new edge
	 * 
	 * @param docID
	 *            the documents id
	 * @param startToken
	 *            the first tokens index
	 * @param endToken
	 *            the last tokens index
	 * @param startNode
	 *            the start node
	 * @return the edge
	 */
	STreeEdge createEdge(int docID, int startToken, int endToken, int startNode);

	STreeEdge createEdgeReplace(int docID, int startToken, int endToken, int startNode);

	STreeEdge removeEdge(STreeEdge edge);
	STreeEdge addEdge(STreeEdge edge);
	/**
	 * Returns an edge
	 * 
	 * @param startNode
	 *            the start node
	 * @param token
	 *            the start token
	 * @return the edge or null if no matching edge exists
	 */
	STreeEdge find(int startNode, int token);

	void remove(STreeEdge edge);
}
